package com.yxjx.duoxue.datamodel.school;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import com.yxjx.duoxue.datamodel.DMObject;
import com.yxjx.duoxue.utils.UIHelper;

/**
 * 品牌影响力
 *
 * @author zhangxs
 * @date 2015年2月6日
 *
 */
public class SchoolDetailBrandDTS extends DMObject implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = -450981400983586700L;
	// private Integer schoolId = -1;
    // 品牌历史
    private String brandHistory = "";
    // 分校数量
    private String brandSchoolCount = "";
    // 累计学员
    private String brandStudentCount = "";
    // 获奖情况
    private String brandAward = "";

    // public Integer getSchoolId() {
    // return schoolId;
    // }
    //
    // public void setSchoolId(Integer schoolId) {
    // this.schoolId = schoolId;
    // }

    public String getBrandHistory() {
        return brandHistory;
    }

    public void setBrandHistory(String brandHistory) {
        this.brandHistory = brandHistory;
    }

    public String getBrandSchoolCount() {
        return brandSchoolCount;
    }

    public void setBrandSchoolCount(String brandSchoolCount) {
        this.brandSchoolCount = brandSchoolCount;
    }

    public String getBrandStudentCount() {
        return brandStudentCount;
    }

    public void setBrandStudentCount(String brandStudentCount) {
        this.brandStudentCount = brandStudentCount;
    }

    public String getBrandAward() {
        return brandAward;
    }

    public void setBrandAward(String brandAward) {
        this.brandAward = brandAward;
    }

    @Override
    public String toString() {
        return "{\"brandHistory\":\"" + brandHistory + "\", \"brandSchoolCount\":\"" + brandSchoolCount + "\", \"brandStudentCount\":\"" + brandStudentCount
                + "\", \"brandAward\":\"" + brandAward + "\"}";
    }
    
    public static SchoolDetailBrandDTS from(String str) {
    	if (UIHelper.isEmpty(str)) {
    		return null;
    	}
    	try {
			JSONObject jo = new JSONObject(str);
			SchoolDetailBrandDTS item = new SchoolDetailBrandDTS();
			item.setBrandAward(castString(jo,"brandAward"));
			item.setBrandHistory(castString(jo,"brandHistory"));
			item.setBrandSchoolCount(castString(jo,"brandSchoolCount"));
			item.setBrandStudentCount(castString(jo,"brandStudentCount"));
			return item;
		} catch (JSONException e) {
			e.printStackTrace();
			return null;
		}
    }
}